<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<script type="text/javascript">
    var rowId = 0;
    $('fbox_monthlyincomeGrid .ui-reset , #refresh_monthlyincomeGrid').click(function(){
        $("#monthlyincomeGrid").jqGrid('setGridParam',{search:false});
        var postData = $("#monthlyincomeGrid").jqGrid('getGridParam','postData');
        $.extend(postData,{searchField:"",searchString:"",searchOper:""});
        $.extend(postData,{filters:""});
        $("#monthlyincomeGrid").trigger("reloadGrid");
    });

    $.subscribe('searchmonthlyincomeGrid', function(event,data) {
        $("#monthlyincomeGrid").jqGrid('searchGrid', {closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:"Search Monthly Income"} );
    });
    
    $.subscribe('monthlyincomeGridComplete',function(event,data){
        $( "#monthlyincomeGrid_search" ).button( "option", "disabled", false );
    });

</script>
<div class="gridOptsContainer">
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="monthlyincomeGrid_search" onClickTopics="searchmonthlyincomeGrid" value="Search Monthly Income"/>
</div>
<s:url id="remoteurl" action="grid-monthlyincome"/>

<sjg:grid
    id="monthlyincomeGrid"
    caption="Cashmate Monthly Income"
    cellEdit="true"
    dataType="json"
    href="%{remoteurl}"
    gridModel="gridModel"
    pagerButtons="true"
    pagerInput="true"
    rowList="15,30,50"
    rowNum="15"
    loadingText="Requesting Data..."
    width="970"
    shrinkToFit="true"
    pager="true"
    hoverrows="true"
    rownumbers="true"
    autoencode="true"
    viewrecords="true"
    navigator="true"
    navigatorAdd="false"
    navigatorDelete="false"
    navigatorEdit="false"
    navigatorSearch="true"
    navigatorSearchOptions="{closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:'Search monthlyincome'}"
    navigatorView="true"
    onGridCompleteTopics="monthlyincomeGridComplete"
    >

    <sjg:gridColumn name="incomeid"
                    index="incomeid"
                    title="Income ID"
                    sortable="false"
                    key="true"
                    hidden="true"
                    />

    <sjg:gridColumn name="business"
                    index="business"
                    title="Business"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="employement"
                    index="employement"
                    title="Employement"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="spouseincome"
                    index="spouseincome"
                    title="Spouse Income"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="othersources"
                    index="othersources"
                    title="Other sources"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="grossincome"
                    index="grossincome"
                    title="Gross Income"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="rentexpense"
                    index="rentexpense"
                    title="Rent Expense"
                    sortable="true"
                    align="center"
                    />

    <sjg:gridColumn name="foodandclothing"
                    index="foodandclothing"
                    title="Food and Clothing"
                    sortable="true"
                    align="center"
                    />
    <sjg:gridColumn name="education"
                    index="education"
                    title="Education"
                    sortable="true"
                    align="center"
                    />
    <sjg:gridColumn name="outstandingloan"
                    index="outstandingloan"
                    title="Outstandingloan"
                    sortable="true"
                    align="center"
                    />
    <sjg:gridColumn name="totalexpenses"
                    index="totalexpenses"
                    title="Total Expenses"
                    sortable="true"
                    align="center"
                    />
    <sjg:gridColumn name="netincomebeforetax"
                    index="netincomebeforetax"
                    title="Net income before tax"
                    sortable="true"
                    align="center"
                    />



</sjg:grid>